home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / pvm34b3.zip / pvm34b3 / pvm3 / src / pvmmimd.h < prev    next >
C/C++ Source or Header  |  1997-07-22  |  6KB  |  194 lines

  1.  
  2. /* $Id: pvmmimd.h,v 1.6 1997/06/25 22:11:09 pvmsrc Exp $ */
  3.  
  4. /*
  5.  *         PVM version 3.4:  Parallel Virtual Machine System
  6.  *               University of Tennessee, Knoxville TN.
  7.  *           Oak Ridge National Laboratory, Oak Ridge TN.
  8.  *                   Emory University, Atlanta GA.
  9.  *      Authors:  J. J. Dongarra, G. E. Fagg, M. Fischer
  10.  *          G. A. Geist, J. A. Kohl, R. J. Manchek, P. Mucci,
  11.  *         P. M. Papadopoulos, S. L. Scott, and V. S. Sunderam
  12.  *                   (C) 1997 All Rights Reserved
  13.  *
  14.  *                              NOTICE
  15.  *
  16.  * Permission to use, copy, modify, and distribute this software and
  17.  * its documentation for any purpose and without fee is hereby granted
  18.  * provided that the above copyright notice appear in all copies and
  19.  * that both the copyright notice and this permission notice appear in
  20.  * supporting documentation.
  21.  *
  22.  * Neither the Institutions (Emory University, Oak Ridge National
  23.  * Laboratory, and University of Tennessee) nor the Authors make any
  24.  * representations about the suitability of this software for any
  25.  * purpose.  This software is provided ``as is'' without express or
  26.  * implied warranty.
  27.  *
  28.  * PVM version 3 was funded in part by the U.S. Department of Energy,
  29.  * the National Science Foundation and the State of Tennessee.
  30.  */
  31.  
  32. /*
  33.  *  pvmmimd.h
  34.  *
  35. $Log: pvmmimd.h,v $
  36.  * Revision 1.6  1997/06/25  22:11:09  pvmsrc
  37.  * Markus adds his frigging name to the author list of
  38.  *     every file he ever looked at...
  39.  *
  40.  * Revision 1.5  1997/05/05  20:06:15  pvmsrc
  41.  *     Extend the size of the info array passed to mpp tasks on startup.
  42.  *
  43.  * Revision 1.4  1997/04/25  19:15:42  pvmsrc
  44.  * added BUSYWAIT #def needed by shmem version (via lpvmglob.c)
  45.  *
  46.  * Revision 1.3  1997/03/06  21:12:58  pvmsrc
  47.  *         - Changed everything :-)
  48.  *             tid structure changed.
  49.  *             lots of macro changes
  50.  *             defines for message types.
  51.  *             reorganized.
  52.  *
  53.  * Revision 1.2  1997/01/28  19:28:22  pvmsrc
  54.  * New Copyright Notice & Authors.
  55.  *
  56.  * Revision 1.1  1996/09/23  23:43:30  pvmsrc
  57.  * Initial revision
  58.  *
  59.  * Revision 1.8  1995/06/16  16:09:30  manchek
  60.  * changed size of PGON host info array to 10
  61.  *
  62.  * Revision 1.7  1995/06/12  18:24:20  manchek
  63.  * SIZEHINFO only affects PGON for now
  64.  *
  65.  * Revision 1.6  1995/06/12  16:01:56  manchek
  66.  * changed SIZEHINFO to 6
  67.  *
  68.  * Revision 1.5  1995/05/30  17:50:23  manchek
  69.  * Added new defines for SP2MPI architecture
  70.  *
  71.  * Revision 1.4  1994/11/08  19:19:23  manchek
  72.  * mpp fixes
  73.  *
  74.  * Revision 1.3  1994/06/03  20:38:25  manchek
  75.  * version 3.3.0
  76.  *
  77.  * Revision 1.2  1993/12/20  15:39:44  manchek
  78.  * patch 6 from wcj
  79.  *
  80.  * Revision 1.1  1993/08/30  23:26:51  manchek
  81.  * Initial revision
  82.  *
  83.  */
  84.  
  85. #ifndef __PVMMIMD_H__
  86. #define __PVMMIMD_H__
  87. /* ====== SECTION I (STRUCTURE DEFINITIONS) ====== */
  88.  
  89. /* nodes in use */
  90. struct nodeset {
  91.     struct nodeset *n_link;        /* linked list */
  92.     struct nodeset *n_rlink;
  93.     int n_size;                    /* number of nodes */
  94.     int n_first;                /* the first node in the set */
  95.     int n_ptype;                /* (PGON) ptype of tasks on the nodes  */
  96.     int n_alive;                /* number of active nodes */
  97.     int n_ptid;                    /* tid of task who spawned us */
  98. #ifdef IMA_I860
  99. #define n_cid    n_ptype            /* the global qm_cubeid */
  100.     char *n_name;                /* cube name */
  101. #endif
  102. };
  103.  
  104. /* ====== SECTION II (TIDS) ====== */
  105.  
  106. /* PVM task identifiers are 32 bits. The first 18 bits are assigned
  107.  * by the local pvmd. The following summarizes the pvm tid breakdown:
  108.  *
  109.  *    |31 |30 |29                  18|17                      0|
  110.  *    | s | g |   < host part >      |    <local part>         |
  111.  *
  112.  * MPPs further break down the <local part> as follows:
  113.  *
  114.  *     17  16    14 13             0
  115.  *    | n | <part> |   <phys node>  |
  116.  *
  117.  * bits  0 - 13 represent the physical node # --> 16384 nodes
  118.  * bits 14 - 16 represent partition ids --> 8 simulatenous partitions
  119.  * bit  17 - 17 task is a compute node (bit set) or service node (not set)
  120. */
  121.     
  122. #define NODEWIDTH        14        /* 14 bits for nodes - 16K nodes */
  123. #define PARTWIDTH        3        /* 4 bits for partitions - 8 partitions */
  124. #define CNODEWIDTH        1        /* 1 bit to indicate a node task */
  125. /*                        ---
  126.  *                        18      <--- must sum to 18, unless tid defn changes 
  127. */
  128.  
  129. #define MAXNODES        (1 << NODEWIDTH )   /* 2^NODEWIDTH */
  130. #define NPARTITIONS        (1 << PARTWIDTH )    /* 2^PARTWIDTH */
  131. #define NODESTATES        (1 << CNODEWIDTH)   /* 2^CNODEWIDTH */
  132.  
  133.  
  134. /* Masks for the above information */
  135.  
  136. /* -- First NODEWIDTH bits, mask for the node number */
  137. #define TIDNODE        (MAXNODES - 1)                     
  138.  
  139. /* -- next PARTWIDTH bits, mask for the partition identifier */
  140. #define TIDPTYPE    ((NPARTITIONS -1 ) << NODEWIDTH)
  141.  
  142. /* -- next NODESTATES bits, mask for service/compute part residency */
  143. #define TIDONNODE    ((NODESTATES - 1) << (NODEWIDTH + PARTWIDTH))
  144.  
  145. /*
  146. #define TIDNODE            0x00003fff     first NODEWIDTH BITS 
  147. #define TIDPTYPE        0x0001c000     next  PARTWIDTH BITS 
  148. #define TIDONNODE        0x00020000     next  CNODEWIDTH BITS 
  149. */
  150. /* ====== SECTION III (CONSTANTS, MESSAGE CONSTANTS) ====== */
  151.  
  152.  
  153. #define MAXFRAGSIZE    (0x00004000 - 16)    /* max fragment size (16K - 16) */
  154. #define MXPP        256            /* maximum number of pre-posted recv buffers */
  155. #define MPPANY        -1
  156. #define MPPREPOST    1
  157.  
  158. #define PVMDPTYPE    0            /* process type of pvmd */
  159. #define SIZEHINFO    20            /* size of hostinfo array */
  160.  
  161.                                              /* need by lpvmglob */
  162. #define      BUSYWAIT        1000000         /* max wait cycles before backing off */
  163.  
  164. /* Packed messages arrive in pre-posted receive buffers with a certain
  165.  * physical tag.  For peer-peer communication, pvm message fragments 
  166.  * arrive in buffers with tags in the range [PMTPBASE, PMTPBASE+MXPP-1].
  167.  * Bodies of inplace messages arrive  
  168. */
  169.  
  170. #define PMTCONF         (MAXNODES+1)    /* Initial configuration message */
  171. #define PMTHOST        (PMTCONF+1)        /* tag for bcasting myhostpart (I860) */
  172. #define PMTPHYS        (PMTCONF+2)        /* tag for physical node# (I860) */
  173. #define PMTDBASE    (PMTCONF+3)        /* base tag for pre-posted recvs from pvmd*/
  174. #define PMTPBASE    (PMTDBASE+MXPP)    /* base tag for pre-posted recvs from peer*/
  175.  
  176.  
  177.  
  178. /* ====== SECTION IV (MACROS) ====== */
  179.  
  180. /* determine if task is a node process */
  181. #define TIDISNODE(x)    (!((x)&(TIDGID|TIDPVMD)) && ((x)&TIDONNODE))
  182.  
  183. /* extract the ptype bits */
  184. #define TIDTOTYPE(x)    ((x)&TIDPTYPE)>>(NODEWIDTH)
  185.  
  186. /* ====== SECTION V (Prototypes) ====== */
  187.  
  188. struct ttpcb * mpp_ttpcb_find __ProtoGlarp__( (int tid) ); 
  189. struct frag * pvm_readfrompvmd __ProtoGlarp__( () );
  190. struct frag * pvm_readfrompeer __ProtoGlarp__( () );
  191. struct pmsg * pvm_mpp_pmsgs __ProtoGlarp__( () );
  192.  
  193. #endif
  194.